package demo.maven.bean.singleton;

/**
 * 同步延迟加载 — 使用内部类实现延迟加载
 * 饥饿和懒汉的结合
 * @author peter
 * @date 2022/12/5 下午16:25
 */
public class Singleton5 {
    public static class Holder {
        private static Singleton5 singleton5 = new Singleton5();
    }
    private Singleton5(){}

    public static Singleton5 getInstance() {
        return Holder.singleton5;
    }
}
